<?php

class Users_Form_Signup extends Zend_Form
{

    public function init() {
        $this->setMethod('post')
                ->setAction('/user/register');

        //email
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email')
                ->setOptions(array('placeholder'=>'Enter your Email Id'))
                ->addFilter('StringToLower')
                ->setRequired(true)
                ->addValidator('EmailAddress')
                ->addErrorMessage("Enter valid email address....");

        //password
        $password1 = new Zend_Form_Element_Password('password1');
        $password1->setLabel('Password')
                ->addValidator('StringLength',false,array(6))
                ->setOptions(array('placeholder'=>'Min. 6 character'))
                ->setRequired(true);                

        $password2 = new Zend_Form_Element_Password('password2');
        $password2->setLabel('Confirm Password')
                ->addValidator('StringLength',false,array(6))
                ->setOptions(array('placeholder'=>'Min. 6 character'))
                ->setRequired(true);
        


        //submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Sign Up')
                ->setOptions(array('class' => 'submit'))
                ->setAttrib('class', 'btn btn-success');


        $this->addElements(array($email,$password1,$password2, $submit));
        $this->addDisplayGroup(array('email','password1','password2','submit'),'reg');
        $this->getDisplayGroup('reg')
                ->setLegend('Registration');
    }


}

